<template>
  <view style="opacity: 0">
    <img style="width: auto; height: 32px; pointer-events: auto;" :src="`/industry/static/map/poi_${data.iconType}.png`" mode="aspectFit" :data="JSON.stringify(data)" onclick="iconViewImghandleClick(event)" />
    <view class="poi-name">{{data.name || data.matchingName}}</view>
  </view>
</template>

<script>
export default {
  name: 'MatchingView',
  props: {
    data: {
      type: Object,
      default: () => ({}),
    },
  },
  mounted(){
    window.iconViewImghandleClick = this.iconViewImghandleClick
  },
  methods: {
    iconViewImghandleClick(e){
      const json = e.currentTarget.getAttribute('data')
      const data = JSON.parse(json)
      console.log(data.name)
      this.$emit('click', data)
    }
  },
  data() {
    return {
    }
  },
}
</script>

<style scoped lang="scss">
.poi-name{
  font-size: 28rpx;
  font-weight: normal;
  line-height: normal;
  letter-spacing: 0em;

  font-variation-settings: "opsz" auto;
  font-feature-settings: "kern" on;
  color: #020202;
}
</style>
